<template>
	<view class="back_top" @click="backTop">
		<image src="/static/icon-top.png" class="icon-top"></image>
	</view>
</template>

<script>
	export default {
		methods:{
			backTop(){
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 100
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.back_top{
	width: 66rpx;
	height: 66rpx;
	border-radius: 50%;
	background-color: $uni-color-primary;
	position: fixed;
	right: 24rpx;
	bottom: 130rpx;
	z-index: 50;
	margin-bottom: constant(safe-area-inset-bottom); 
	margin-bottom: env(safe-area-inset-bottom);
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	opacity: 0.77;
	.icon-top{
		width: 32rpx;
		height: 32rpx;
	}
}
</style>
